﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GKQC.DbHelper.ViewModels
{
    /// <summary>
    /// 内置基础资料
    /// </summary>
    [SugarTable("t_sys_basedata")]
    public class BaseDataModel
    {
        /// <summary>
        /// 流水号
        /// </summary>		
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public long Id { get; set; }

        public string TypeCode { get; set; } = string.Empty;
        public string TypeName { get; set; } = string.Empty;

        public string Code { get; set; } = string.Empty;
        public string Name { get; set; } = string.Empty;

        public string ErpCodes { get; set; } = string.Empty;

        public int IsUse { get; set; } = 1;

        public int IsSys { get; set; }

        public string Remark { get; set; } = string.Empty;
        public string Group { get; set; } = string.Empty;

        /// <summary>
        /// 排序号
        /// </summary>
        public int SNo { get; set; }

        [SugarColumn(IsIgnore = true)]
        public bool IsModified { get; set; }

        [SugarColumn(IsIgnore = true)]
        public string GroupAndName { 
            get { return (string.IsNullOrWhiteSpace(Group) ? Name : (Group + " " + Name)); } }
    }
}
